home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / TEXT2DBF.ZIP;1 / BASIC.CH next >
Encoding:
Text File  |  1992-09-14  |  3.5 KB  |  90 lines

  1. /***
  2. *   BASIC.CH   Copyright (c) BITwise Computer Services, 1992
  3. *
  4. *      - Basic enhancements to Clipper command set
  5. */
  6.  
  7.  
  8. // ALWAYS INCLUDE KEYBOARD DEFINITIONS
  9. #include "inkey.ch"
  10. #include "dbfntx.ch"
  11.  
  12. // ADDITIONAL KEYBOARD DEFINITIONS
  13. #define K_MLEFT          -100    // LEFT MOUSE BUTTON
  14. #define K_MRIGHT         -200    // RIGHT MOUSE BUTTON
  15. #define K_EXCEPTION      -300    // KEYBOARD EXCEPTION
  16. #define K_TIMEOUT        -400    // P_INKEY() TIMEOUT
  17. #define K_SPACE            32    // Spacebar
  18. #define K_CTRL_UP         397    // Ctrl-Up
  19. #define K_CTRL_DOWN       401    // Ctrl-Down
  20. #define K_CTRL_ENTER       10    // Ctrl-Enter
  21. #define K_PLUS             43    // <+>
  22. #define K_MINUS            45    // <->
  23.  
  24. // ADDITIONAL GET EXITSTATE DEFINITIONS
  25. #define GE_TIMEOUT         20
  26. #define READBUTTONS        "<CTRL-ƒŸ=Save>  <ESC=Abort>"
  27. #define DIALOGBUTTONS      "<CTRL-ƒŸ=OK>  <ESC=Abort>"
  28.  
  29. // MSGBOX DEFINES
  30. #define OK       1
  31. #define WAIT     2
  32. #define NONE     0
  33. #define ERROR    1
  34. #define ATTN     2
  35. #define SUCCESS  3
  36.  
  37.  
  38. /****
  39. *   Modified Standard Commands
  40. */
  41.  
  42. #command SEEK <xpr> ALIAS <a>   =>  <a> -> ( dbSeek(<xpr>) )
  43.  
  44. #command SEEK <xpr> IN <a>      =>  <a> -> ( dbSeek(<xpr>) )
  45.  
  46. #command SET INDEX TO <(file)> ADDITIVE  => dbSetIndex( <(file)> )
  47.  
  48. // DBFNTX Ver 2.0 ONLY!!!
  49. #command INDEX ON <key> TO <(file)> PROGRESS                             ;
  50.          [MESSAGE <msg>]                                                 ;
  51.          [FOR <for>]                                                     ;
  52.          [<all:ALL>]                                                     ;
  53.          [WHILE <while>]                                                 ;
  54.          [NEXT <next>]                                                   ;
  55.          [RECORD <rec>]                                                  ;
  56.          [<rest:REST>]                                                   ;
  57.          [<unique: UNIQUE>]                                              ;
  58.          [<ascend: ASCENDING>]                                           ;
  59.          [<descend: DESCENDING>]                                         ;
  60.                                                                          ;
  61.       => P_PROGWIN(<msg>)                                                ;
  62.          ; P_PROGINIT(RECCOUNT())                                        ;
  63.          ; _dtxCondSet( <"for">, <{for}>,                                ;
  64.                       if( <.all.>, .t., NIL ),                           ;
  65.                       <{while}>,                                         ;
  66.                       {|| P_PROGRESS(RECNO())}, LASTREC()/20,            ;
  67.                       RECNO(), <next>, <rec>,                            ;
  68.                       if( <.rest.>, .t., NIL ),                          ;
  69.                       if( (<.descend.> .AND. !<.ascend.>), .t., NIL ))   ;
  70.          ; dbCreateIndex(<(file)>, <"key">, <{key}>,                     ;
  71.                        if( <.unique.>, .t., NIL ))                       ;
  72.          ; P_PROGRESS(RECCOUNT())                                        ;
  73.          ; P_POPWIN()
  74.  
  75.  
  76. /****
  77. *   Additional "Standard" Commands
  78. */
  79.  
  80. // "COMPILES" A CHARACTER STRING EXPRESSION INTO A CODEBLOCK
  81. #define COMPILE(exp)   &("{|| "+exp+"}")
  82.  
  83. // ASSIGN DEFAULT VALUES TO NIL PARAMETERS OR VARIABLES
  84. #command DEFAULT <p> TO <val> [,<pn> TO <valn>]  => ;
  85.                  <p>:=IF(<p> == NIL,<val>,<p>) ;
  86.                  [; <pn>:=IF(<pn> == NIL,<valn>,<pn>)]
  87.  
  88.  
  89. //EOF
  90.